package user_dto

import (
	"github.com/ifnk/micro-blog/protobuf/permission_pb"
)

// Permission register structure
type Register struct {
	Username  string `json:"userName"`
	Password  string `json:"passWord"`
	Email     string `json:"email"`
	NickName  string `json:"nickName" gorm:"default:'QMPlusUser'"`
	HeaderImg string `json:"headerImg" gorm:"default:'https://qmplusimg.henrongyi.top/gva_header.jpg'"`
}

// Permission login structure
type Login struct {
	Username  string `json:"username"`  // 用户名
	Password  string `json:"password"`  // 密码
	Captcha   string `json:"captcha"`   // 验证码
	CaptchaId string `json:"captchaId"` // 验证码ID
}

// Modify password structure
type ChangePasswordStruct struct {
	Username    string `json:"username"`    // 用户名
	Password    string `json:"password"`    // 密码
	NewPassword string `json:"newPassword"` // 新密码
}

// Modify  user's auth structure
type SetUserAuth struct {
	AuthorityIds []uint64 `json:"authorityId"` // 角色ID
	UserId       uint64   `json:"userId"`      // 角色ID
}

// Modify  user's auth structure
type SetUserAuthorities struct {
	ID           uint
	AuthorityIds []string `json:"authorityIds"` // 角色ID
}
type LoginResponse struct {
	User      permission_pb.UserORM `json:"user"`
	Token     string                `json:"token"`
	ExpiresAt int64                 `json:"expiresAt"`
}

type UserDto struct {
	User      permission_pb.UserORM
	Authority []permission_pb.AuthorityORM
}
type TokenParams struct {
	Token string `json:"token"`
}
type IdsParams struct {
	Ids []float64 `json:"ids"`
}
